package org.tech4j.common.core.sign.extractor;

import jakarta.servlet.http.HttpServletRequest;
import org.tech4j.common.core.sign.api.SignParameters;

/**
 * @program: tech4j-common
 * @description:
 * @author: YuKai Fan
 * @create: 2025/3/2 19:43
 **/
public interface SignParameterExtractor {


    /**
     * Extracts signParameters from requestBody.
     * @param requestBody requestBody
     * @return signParameters
     */
    default SignParameters extract(String requestBody) {return new SignParameters(); }


    /**
     * Extracts signParameters from httpRequest.
     * @param request HttpServletRequest
     * @return signParameters
     */
    SignParameters extract(HttpServletRequest request);

    /**
     * Extracts signParameters from httpRequest.
     * @param request HttpServletRequest
     * @param paramType paramType
     * @param paramKey paramKey
     * @return signParameters
     */
    SignParameters extract(HttpServletRequest request, String paramType, String paramKey);
}
